1. Field of the Invention
Embodiments of the present disclosure are related to methods of computer management, and particularly to a method for changing power states of a computer.
2. Description of Related Art
Computers may have a total of six different power states ranging from S0 to S5. In state S0, the computer is completely powered on and fully operational, while in state S5, the computer is completely powered off. The states S1, S2, S3 and S4 are referred to as sleep states, in which the computer appears off in order to conserve power. The computer in any sleep state retains enough of the hardware context, thus can return to the work state S0 without a system reboot. If the computer in state S1, S2, or S3 loses battery power, it will lose all the hardware context, therefore, the computer must reboot to return to state S0. The computer in state S4 can restart from its previous location even after it loses battery power, because operating system context is retained in a memory image, which was written to a disk by the computer before entering state S4.
However, if enabled applications have not been stored before the computer goes to state S4 from S0, and the boot device (e.g. a hard disk) of the computer is changed before the computer loses battery power, the computer cannot return to state S0 when resuming battery power because of the boot device has been changed, thus, the applications cannot be restored. In addition, because reading the memory image from the disk spends much time, restarting the computer from state S4 to S0 has a long wake-up latency.
What is needed, therefore, is a method for changing power states of a computer, which can change the power states of the computer between state S0 and S4 with high efficiency.